<?php

namespace common\logics;

use Yii;
use yii\helpers\Url;
use yii\helpers\ArrayHelper;
use common\models\dynamic\DynamicLikeLog;

/**
 * This is the model class for table "{{%user}}".
 *
 * @property int $id
 * @property string $username
 * @property string $mobile
 * @property string $email
 * @property string $avatar 头像
 * @property string $auth_key
 * @property string $password_hash
 * @property string $password_reset_token
 * @property string $ip
 * @property int $status
 * @property string $created_at
 * @property string $updated_at
 * @property string $deleted_at
 */
class UserLogic extends \common\models\user\UserMeta {

    public function getTsline() {
        return [
            'id' => 1,
            'authent' => false,
        ];
    }

    public function getRecentActiveTime() {
        return '刚刚';
    }

    public function fields() {
        return ArrayHelper::merge(parent::fields(), [
            'tsline',
            'recent_active_time' => 'recentActiveTime',
            'followed' => function() {
                return false;
            },
            'vip' => function() {
                return false;
            },
            'follows' => function() {
                return 1;
            },
            'fans' => function() {
                return rand(0, 1000);
            },
            'fans_link' => function() {
                return "";
            },
            'follows_link' => function() {
                return "";
            }
        ]);
    }

}
